import requests

loginUrl= "https://mis.uic.edu.hk/mis/usr/login.sec"

session = requests.Session()

postdata = {
    'j_target_url': "https://mis.uic.edu.hk/mis/student/tts/timetable.do",
    'j_username': "username",
    'j_password': "password",
    'usertype': "on",
    'x': "",
    'y': ""
}

header = {
    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0",
    'Referer': loginUrl
}

html_post = session.post(loginUrl, postdata, headers=header, verify=False)

print(html_post.url)

save=open("mis.html","wb")
save.write(html_post.text.encode())
save.close()